package com.example.helloworld.controller;

import com.example.helloworld.bean.Person;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ImportResource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.logging.Logger;

//@ImportResource(locations = {"classpath:/beans.xml"})
@Controller
public class HelloController {
    @Autowired
    private Person person;

    @ResponseBody
    @RequestMapping("/hello")
    public String hello(){
        return "Hello World";
    }

    @ResponseBody
    @RequestMapping("/hi")
    public Person hi(){
        return person;
    }

}
